package com.tp3.nutribar;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.text.Html;
import android.view.Menu;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;

public class Statistiques extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_statistiques);
        
        final Button button_profil = (Button) findViewById(R.id.profil_sante_bouton);
        button_profil.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
            	Intent myIntent = new Intent(Statistiques.this, ActProfilSante.class);
            	Statistiques.this.startActivity(myIntent);
            }
        });
        
        final Button button_dashboard = (Button) findViewById(R.id.resume_journee_bouton);
        button_dashboard.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
            	Intent myIntent = new Intent(Statistiques.this, Dashboard.class);
            	Statistiques.this.startActivity(myIntent);
            }
        });
        
        final Button button_ajouter_repas = (Button) findViewById(R.id.ajouter_repas_bouton);
        button_ajouter_repas.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
            	Intent myIntent = new Intent(Statistiques.this, AjouterRepasPart1.class);
            	Statistiques.this.startActivity(myIntent);
            }
        });
        
        final Button button_mois = (Button) findViewById(R.id.mois_bouton);
        button_mois.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
            	//change graph source
            	ImageView graph  = (ImageView)findViewById(R.id.graph);
                graph.setImageResource(R.drawable.stat_monthly);
              
                //change output message
                TextView message  = (TextView)findViewById(R.id.textViewComments);
                message.setText(R.string.commentaires_mois);
            }
        });
        
        final Button button_semaine = (Button) findViewById(R.id.semaine_bouton);
        button_semaine.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
            	//change graph source
            	ImageView graph  = (ImageView)findViewById(R.id.graph);
                graph.setImageResource(R.drawable.stat_weekly);
                
                //change output message
                TextView message  = (TextView)findViewById(R.id.textViewComments);
                message.setText(R.string.commentaires_semaine);
            }
        });

    }
   

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_statistiques, menu);
        return true;
    }
}
